package request

import (
        "topsdk/util"
    )

type TaobaoMiniappTemplateRollbackRequest struct {
    /*
        要回滚的投放端,目前可投放： taobao,tmall     */
    Clients  *[]string `json:"clients" required:"true" `
    /*
        小程序app_id     */
    AppId  *string `json:"app_id" required:"true" `
    /*
        回到到该app_version     */
    AppVersion  *string `json:"app_version" required:"true" `
    /*
        实例化小程序对应的模板id     */
    TemplateId  *string `json:"template_id" required:"true" `
    /*
        与app_version对应的模板版本     */
    TemplateVersion  *string `json:"template_version" required:"true" `
}

func (s *TaobaoMiniappTemplateRollbackRequest) SetClients(v []string) *TaobaoMiniappTemplateRollbackRequest {
    s.Clients = &v
    return s
}
func (s *TaobaoMiniappTemplateRollbackRequest) SetAppId(v string) *TaobaoMiniappTemplateRollbackRequest {
    s.AppId = &v
    return s
}
func (s *TaobaoMiniappTemplateRollbackRequest) SetAppVersion(v string) *TaobaoMiniappTemplateRollbackRequest {
    s.AppVersion = &v
    return s
}
func (s *TaobaoMiniappTemplateRollbackRequest) SetTemplateId(v string) *TaobaoMiniappTemplateRollbackRequest {
    s.TemplateId = &v
    return s
}
func (s *TaobaoMiniappTemplateRollbackRequest) SetTemplateVersion(v string) *TaobaoMiniappTemplateRollbackRequest {
    s.TemplateVersion = &v
    return s
}

func (req *TaobaoMiniappTemplateRollbackRequest) ToMap() map[string]interface{} {
    paramMap := make(map[string]interface{})
    if(req.Clients != nil) {
        paramMap["clients"] = util.ConvertBasicList(*req.Clients)
    }
    if(req.AppId != nil) {
        paramMap["app_id"] = *req.AppId
    }
    if(req.AppVersion != nil) {
        paramMap["app_version"] = *req.AppVersion
    }
    if(req.TemplateId != nil) {
        paramMap["template_id"] = *req.TemplateId
    }
    if(req.TemplateVersion != nil) {
        paramMap["template_version"] = *req.TemplateVersion
    }
    return paramMap
}

func (req *TaobaoMiniappTemplateRollbackRequest) ToFileMap() map[string]interface{} {
    fileMap := make(map[string]interface{})
    return fileMap
}